/*
 * Grabber.h
 *
 *  Created on: Apr 6, 2011
 *      Author: dhargrav
 */

#ifndef GRABBER_H_
#define GRABBER_H_

#include <QObject>
#include <QString>
#include <QNetworkAccessManager>
#include <QNetworkReply>

class Quote;

namespace Quotes
{

class Grabber :
	public QObject
{
	Q_OBJECT

public:
	Grabber();
	virtual ~Grabber();

	void getQuote(const QString &sym);

signals:
	void quoteReady(Quote *);
	void quoteError(const QString &sym);

public slots:
	void readyRead();
	//void finished(QNetworkReply*);
	//void error(QNetworkReply::NetworkError);


private:
	static QString msHost;
	static QString msPath;

	QString mSymbol;

	QNetworkAccessManager* manager;
	QNetworkReply* currentReply;

};

}

#endif /* GRABBER_H_ */
